1. Field of the Invention
This invention relates to an image processing apparatus and method and, more particularly, to an image processing apparatus and method which performs correction processing such as exposure compensation and white balance adjustment for digital images.
2. Description of the Related Art
Various types of image processing apparatuses having the functions of performing various processes and correction processing in forming multivalued digital images have been proposed and put into practice.
For example, some of these apparatuses are designed to perform exposure compensation for images. Exposure compensation in a conventional image processing apparatus is implemented by adjusting the luminance of an original image by increasing/decreasing the overall luminance.
In addition, some of the above image processing apparatus perform so-called white balance adjustment to obtain an image with high contrast by adjusting the luminance of a highlight portion which is the brightest portion of an image or a shadow portion which is the darkest portion. In white balance adjustment in the conventional image processing apparatus, the average luminances of R, G, and B pixels, except for pixels having luminances higher than a predetermined threshold, in a predetermined high-luminance area corresponding to a high-luminance range several % from the maximum luminance of an image are calculated, and the respective pixels are corrected on the basis of the average luminances.
In the above image correcting apparatus, exposure compensation does not take contrast information such as the highlight or shadow point of the image into consideration. For this reason, the exposure state of the original image cannot be properly checked, and proper exposure compensation cannot always be performed.
Likewise, white balance adjustment in the conventional image processing apparatus does not take image features such as the scene features presented by a target image into consideration. For this reason, if, for example, all the pixels in a high-luminance area of the image have luminances equal to or higher than a predetermined threshold, since there are no pixels from which average luminances are calculated, white balance adjustment cannot be performed.
For example, a photographic image including a fluorescent lamp in a room as an object image has a so-called blue cast, i.e., the tone of the picture darkens in portions other than the fluorescent lamp. Even if white balance adjustment is performed for such a photographic image, since all the pixels corresponding to the fluorescent lamp have luminances equal to or higher than the predetermined threshold, effective adjustment cannot be performed. Hence, the blue cast cannot be corrected.
In addition, when white balance adjustment is uniformly performed for any scenes, some scene may deteriorate in image quality. If, for example, strong white balance adjustment is performed for a “sunset” scene or “flower garden” scene, the scene is bleached out, and the “sunset” scene may not look like a sunset.